{% extends "base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load dv_filters %}
{% block head_title %}{% blocktrans with session=session %}Suppression de la session {{ session }} ?{% endblocktrans %}{% endblock %}

{% block content %}
    <h1>{% blocktrans with session=session %}Suppression de la session {{ session }} ?{% endblocktrans %}</h1>

    <form method="POST" action="" class="form-horizontal">
        {% csrf_token %}

        <div class="panel panel-danger">
            <div class="panel-heading">
                {% trans "Confirmer" %}
            </div>
            <div class="panel-body">
                <p>{% blocktrans with session=session %}
                    Supprimer la session {{ session }} définitivement
                    (y compris toutes ses Qualifs et saisies d'heures) ?
                {% endblocktrans %}</p>
            </div>
        </div>

        <div class="panel panel-warning">
            <div class="panel-heading">
                {% trans "Qualifs qui seront supprimées" %}
            </div>
            <div class="panel-body">
                {% for quali in session.qualifications.all %}
                    <p>{{ quali }}</p>
                {% endfor %}
            </div>
        </div>

        <div class="panel panel-warning">
            <div class="panel-heading">
                {% trans "Saisies d'heures qui seront supprimées" %}
            </div>
            <div class="panel-body">
                {% for timesheet in session.get_related_timesheets.distinct %}
                    <p><a href="{% url 'salary:user-timesheets' year=timesheet.date.year month=timesheet.date.month pk=timesheet.user.pk %}">
                        {{ timesheet.user.get_full_name }} - {{ timesheet.date }}
                    </a></p>
                {% endfor %}
            </div>
        </div>

        {% buttons %}
            <button type="submit" class="btn btn-danger pull-right">{% trans "Supprimer vraiment" %}</button>
            <a class="btn btn-default" href="{% url 'session-list' seasonpk=season.pk year=session.day|date:"Y" week=session.day|weeknumber %}">{% trans "Retour à la liste des sessions" %}</a>
        {% endbuttons %}
    </form>
{% endblock %}
